package org.graduates.webapp.actions.person;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.graduates.webapp.actions.BaseAction;
import org.projects.graduates.domain.Person;

@Action(results = { @Result(name = "success", type = "json") })
public class SaveProfileAction extends BaseAction {

	private static final long serialVersionUID = -6064271870619591680L;
	private Person person;
	private String error;

	public String execute() {

		System.out.println("\n\n show : " + person.getShowName());
			
		if (null == person || null == person.getId()) {
			error = "对象不能为空";
			return SUCCESS;
		}

		this.gradApplication.save(person);

		return SUCCESS;
	}

	public String getError() {
		return error;
	}

	public void setPerson(Person person) {
		this.person = person;
	}

	public Person getPerson() {
		return person;
	}

}
